<template>
  <div class="left">
    <p>左组件</p>
    {{ count }}
    <button @click="add">count+1</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    add() {
      this.count++;
    },
  },
  created() {
    console.log("left组件被创建了");
  },
  destroyed() {
    console.log("left组件被销毁了");
  },
  activated() {
    console.log('组件被激活了');
  },
  deactivated() {
    console.log('组件被缓存了');
  },
};
</script>

<style scoped>
.left {
  height: 200px;
  width: 50%;
  background-color: coral;
}
</style>